package com.atguigu.test;

import com.atguigu.bean.CarMul;
import com.atguigu.config.MainConfig2;
import com.atguigu.config.MainConfigOgLifeCycle;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class IOCTest_LifeCycle {
    AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOgLifeCycle.class);

    @Test
    public void test01() {
        System.out.println("容器创建完毕");
        CarMul carMulBean = applicationContext.getBean(CarMul.class);
        applicationContext.close();
    }

    @Test
    public void test02() {
        System.out.println("容器创建完毕");
//        CarMul carMulBean = applicationContext.getBean(CarMul.class);
        applicationContext.close();
    }

}
